import Cookies from 'js-cookie'

export function getCookie(name) {
  return Cookies.get(name)
}

export function setCookie(name, cookie, days = 7) {
  // 设置过期原则
  const time = new Date(new Date().getTime() + days * 24 * 60 * 60 * 1000)
  return Cookies.set(name, cookie, { expires: time })
}

export function delCookie(name) {
  return Cookies.remove(name)
}
